local macroName = "Assist"

local onEvent = function(self)
	if not InCombatLockdown() then
		local index = GetPartyAssignment("mainassist")
		
		if index then
			local name = GetRaidRosterInfo(index)
			local macroIndex = GetMacroIndexByName(macroName)
			
			if name and macroIndex then
				EditMacro(macroIndex, macroName, 90, "/assist " .. name, 1, 0)
			end
		end
	end
end

evl_Assist = CreateFrame("Frame")
evl_Assist:SetScript("OnEvent", onEvent)
evl_Assist:RegisterEvent("PLAYER_ENTERING_WORLD")
evl_Assist:RegisterEvent("PLAYER_LEAVING_COMBAT")
evl_Assist:RegisterEvent("RAID_ROSTER_UPDATE")
